import json


def read_json(path):
    try:
        with open(path, "r", encoding="utf-8") as file:
            data = json.load(file)
    except FileNotFoundError:
        pass #print(f"文件{path}未找到")
    except json.JSONDecodeError:
        pass #print(f"文件{path} 不是有效的json")
    else:
        # pass #print(data)
        return data


# 写入json文件
def write_json(content, path):
    with open(path, "w", encoding="utf-8") as file:
        json.dump(content, file, ensure_ascii=False, indent=4)